package com.acorn.community.client.req;

import com.acorn.community.common.exception.BusinessException;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.util.Objects;

/**
 * 获取用户信息
 *
 * @author tianshiwei
 */
@Slf4j
@Data
public class AccessUserReq extends PageReq {

    private Long userId;

    private String openid;

    public void setAccessUser(AccessUserReq accessUserReq) {
        if (Objects.isNull(accessUserReq.getUserId())) {
            log.info("AccessUserReq setAccessUser is null:{}", accessUserReq);
            throw new BusinessException(10001, "用户信息为空");
        }
        this.userId = accessUserReq.getUserId();
        this.openid = accessUserReq.getOpenid();
    }
}
